<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="cc.woori.mobile.bean.ChurchServiceEntry2" %>
<%@ page import="cc.woori.mobile.PMF" %>
<%@ page import="javax.jdo.Extent" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.datastore.KeyFactory" %>
<%@ page import="com.google.appengine.api.datastore.Key" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%
	PersistenceManager pm = PMF.get().getPersistenceManager();
	String vid = request.getParameter("vid");
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy년 MM월 dd일");
	
	try{
		if (vid !=null && !vid.equals("")){
			Key key = KeyFactory.stringToKey(vid);
			ChurchServiceEntry2 e = pm.getObjectById(ChurchServiceEntry2.class, key);
			
%>
<div id="svcinfo_<%=vid%>">
	<div class="toolbar">
		<a href="#" class="back" >뒤로</a>
		<h1>제목 : <%=e.getTitle()%></h1>
	</div>
	<ul class="rounded">
		<li>
			<p>일시: <%=sdf.format(e.getPublishDate()) %></p> 
			<p>제목: <%=e.getTitle() %></p>
			<p>설교자: <%=e.getAuthor() %> 목사</p>
			<p>본문: <%=e.getVerse() %> </p>
		</li>
		<li>
			<a href="<%=e.getSvcVideoUrl() %>" rel="external" class="whiteButton"> 비디오 </a> <br/>
			<a href="<%=e.getSvcAudioUrl() %>" rel="external" class="whiteButton"> 오디오 </a>
		</li>
	</ul>

	
	<ul class="rounded">
		<li>
			설교본문
			<p>
			<%=e.getDescription().getValue() %>
			</p>
		</li>
	</ul>
</div>
<%
		}
	}finally{
		if(pm != null){
			pm.close();
		}
	}
%>